package com.ywjg.controller.jsonp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ywjg.model.CheckDiy;
import com.ywjg.model.DiyMessage;
import com.ywjg.serviceimp.CheckDiyService;
import com.ywjg.serviceimp.DiyMessageService;
@RestController
@RequestMapping(value = "android/")
public class CheckDiyControllerAndroid {
	@Autowired
	CheckDiyService checkDiyService;
	
	@Autowired
	DiyMessageService diyMessageService;
	
	@RequestMapping(value = "checkDiy")
	private CheckDiy checkDiy(CheckDiy checkDiy) {

		return checkDiyService.addCheckDiyInf(checkDiy);
	}
	
	@RequestMapping(value = "getCheckDiyInf")
	private CheckDiy checkCompany(int userId) {
		return checkDiyService.getCheckDiyInf(userId);
	}

	@RequestMapping(value = "upDateCheckDiyInf")
	private CheckDiy upDateCheckDiyInf(CheckDiy checkDiy) {
		return checkDiyService.upDateDiyInf(checkDiy);
	}
	
	@RequestMapping(value = "getOwnMessage")
	private List<DiyMessage> getOwnMessage(int userId) {
		return diyMessageService.getOwerDiyMessage(userId);
	}
	
	
	@RequestMapping(value = "getAllDiyMessage")
	private List<DiyMessage> getAllDiyMessage() {
		return diyMessageService.getAll();
	}

}
